package com.cloudxingkong.dianyinke.Student.Adapter;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.cloudxingkong.dianyinke.R;

import java.util.List;

/**
 * Created by ningfei on 2016/5/27.
 */
public class ComAdapter extends BaseAdapter {
    private Context context;
    private List<Bitmap >list;

    public ComAdapter(Context context, List<Bitmap> list) {
        this.context = context;
        this.list = list;
    }



    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = View.inflate(context, R.layout.item_pingjia_gv, null);
        ImageView ivPic= (ImageView) convertView.findViewById(R.id.pingjia_img_pic);

        ivPic.setImageBitmap(list.get(position));

        return convertView;
    }

}
